import Vue from 'vue'
import VueRouter from 'vue-router'
// -----------------发现音乐
import Discover from '@/components/discover/discover'
import Rec from '../components/discover/son/rec'
import Ranking from '../components/discover/son/ranking'
import PlayList from '../components/discover/son/playlist'
import DJRadio from '../components/discover/son/radio'
import Singer from '../components/discover/son//singer'
import Album from '../components/discover/son/album'
// ---------------------user
import user from '../components/user/user'
import userHome from '../components/user/son/home'
import userLevel from '../components/user/son/level'
import UserEdit from '../components/user/son/userinfoedit'
import userEvent from '../components/user/son/event'
import userFollow from '../components/user/son/follow'
import userFan from '../components/user/son/fans'
// ------------------song
import song from '../components/song/song'
// ------------------artist
import artist from '../components/artister/artister'
import Aalbum from '../components/artister/album'
import MV from '../components/artister/mv'
import Desc from '../components/artister/desc'
//-----------------------MV
import MVplay from '../components/MV/mvinfo'
// -------------------playlist详情
import playlistDetail from '../components/playlist/detail'
// -----------------djradio详情
import DJradiodetail from '../components/djradio/djradio'
import DJcart from '../components/djradio/djcart'
// -----------------program
import Program from '../components/Program/program'
// album
import Albumdetail from '../components/discover/son/newCD'
// ------------------搜索
import Srres from '../components/search/search'
import Songs from '../components/search/son/song'
// ----------------------MY
import MY from '../components/MY/my'
// ------------------------私信
import MSG from '../components/msg/msg'
import Private from '../components/msg/private'
import AT from '../components/msg/at'
import Comment from '../components/msg/comment'
import Notice from '../components/msg/noticefy'
import Dowmload from '../components/download/download'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/discover' },
  // --------------------发现音乐
  {
    path: '/discover',
    component: Discover,
    redirect: '/discover/tui',
    children: [
      // 推荐
      { path: 'tui', component: Rec },
      // 排行榜
      { path: 'toplist', component: Ranking },
      // 歌单
      { path: 'playlist', name: 'playlist', component: PlayList },
      // 主播电台
      {
        path: 'djradio',
        component: DJRadio,
        children: [{ path: 'category', component: DJcart }]
      },
      // 歌手
      { path: 'artist', name: 'singer', component: Singer },
      // 新碟上架
      { path: 'album', name: 'albumMain', component: Album }
    ]
  },
  // --------------------user
  {
    path: '/user',
    component: user,
    redirect: '/user/home',
    children: [
      { path: 'home', component: userHome },
      { path: 'update', component: UserEdit },
      { path: 'event', component: userEvent },
      { path: 'follows', component: userFollow },
      { path: 'fans', component: userFan }
    ]
  },
  // -------------song
  { path: '/song', component: song },
  // ------------artist
  {
    path: '/artist',
    component: artist,
    children: [
      { path: 'album', component: Aalbum },
      { path: 'mv', component: MV },
      { path: 'desc', component: Desc }
    ]
  },
  // --------------------mv
  { path: '/mv', component: MVplay },
  // -------------playlist详情
  { path: '/playlist', component: playlistDetail },
  // ------------------djradio详情
  { path: '/djradio', component: DJradiodetail },
  // ---------------------------program
  { path: '/program', component: Program },
  { path: '/album', component: Albumdetail },
  // -------------------搜索框
  {
    path: '/search',
    component: Srres,
    children: [{ path: 'songs', component: Songs }]
  },
  // -----------------------我的音乐
  { path: '/my', component: MY },
  // -----------------------私信
  {
    path: '/msg',
    component: MSG,
    redirect: '/msg/private',
    children: [
      {
        path: 'private',
        component: Private
      },
      {
        path: 'at',
        component: AT
      },
      {
        path: 'comment',
        component: Comment
      },
      {
        path: 'notify',
        component: Notice
      }
    ]
  },
  { path: '/level', component: userLevel },
  { path: '/download', component: Dowmload }
]

const router = new VueRouter({
  routes
})

export default router
